<!DOCTYPE html>
<html lang="cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Doc Seer</title>
    <link rel="stylesheet" href="./css/style.css">
    <script src="./js/script.js"></script>
    <script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/downloadjs/1.4.8/download.min.js"></script>
</head>

<body>
    欢迎使用MindSpore API文档生成工具!
    <hr>
    请选择功能：
    <button onclick="">手动输入信息生成文档</button>
    <button onclick="">根据英文注释自动生成文档</button>
    <button onclick="">绑定代码工程自动生成文档</button>
    <hr>
    请选择文档语言（中文文档/英文注释）：
    <select id="language" name="language" onchange="selectLanguage()">
        <option value="cn" selected>CN</option>
        <option value="en">EN</option>
    </select>
    如果为英文请选择文档类型（yaml文档/python文档）：
    <select id="writetype" name="writetype" onchange="selectWritetype()">
        <option value="yaml" selected>yaml</option>
        <option value="python">python</option>
    </select>
    <hr>
    <div id="container">
        <div id="left">
            <p id="title_desc">API类型&名称&功能概述：</p>
            <select id="apiType" name="language" onchange="selectApiType()">
                <option id="api_type_class" value="class" selected>Class</option>                
                <option id="api_type_function" value="function">Function</option>
                <option id="api_type_method1" value="method">Method1</option>
                <option id="api_type_method2" value="method">Method2</option>
                <option id="api_type_tensor" value="tensor">overloadtensor</option>
            </select>
            <button onclick="addSample()">初始化</button>
            <input id="api_name" type="input" size="50" placeholder="请填写API完整模块和名称，例：mindspore.ops.Asin"/><br/>           
            <head>
                <meta charset="UTF-8">
                <meta name="viewport" content="width=device-width, initial-scale=1.0">
                <title>Textarea 字体样式</title>
            </head>
            <head>
                <meta charset="UTF-8">
                <meta name="viewport" content="width=device-width, initial-scale=1.0">
                <title>完全显示内容的 Textarea</title>
                <style>
                    #desc {
                        width: 100%; /* 宽度填充整个容器 */
                        height: 300px; /* 设置一个初始高度 */
                        overflow-y: scroll; /* 当内容超出高度时显示垂直滚动条 */
                        resize: both; /* 允许用户调整大小 */
                        font-family: monospace; /* 等宽字体通常用于显示代码 */
                        white-space: pre-wrap; /* 保持格式 */
                    }
                </style>
            </head>
            <body>
                <textarea id="desc" placeholder="请填写接口描述" ></textarea><br>
            <body>

            添加
            <button onclick="addNote()">说明</button>
            <button onclick="addWarning()">告警</button>
            <button onclick="addFormular()">公式</button>
            <button onclick="addCode()">代码块</button>
            <button onclick="addTable()">表格</button>
            <button onclick="addUnorderedList()">无序列表</button>
            <button onclick="addInnerApi()">内部接口参考</button>
            <button onclick="addRaise()">异常</button>
            <!-- <div id="param" style="display:block;">
                <p id="title_param">参数：</p>
                <div id="param_0">
                    <select name="param_type">
                        <option value="int" selected>int</option>
                        <option value="float">float</option>
                        <option value="str">str</option>
                        <option value="bool">bool</option>
                        <option value="dict">dict</option>
                        <option value="list">list</option>
                        <option value="tuple">tuple</option>
                        <option value="Tensor">Tensor</option>
                        <option value="Cell">Cell</option>
                        <option value="Parameter">Parameter</option>
                        <option value="mindspore.dtype">mindspore.dtype</option>
                        <option value="Node">Node</option>
                        <option value="numbers.Number">numbers.Number</option>
                        <option value="numpy.ndarray">numpy.ndarray</option>
                        <option value="FunctionType">FunctionType</option>
                    </select>

                    <input name="param_name" type="text" size="20" placeholder="请填写参数名称">
                    <input name="param_default" type="text" size="10" placeholder="默认值"><br>
                    <textarea name="param_desc" rows="2" cols="60" placeholder="请填写描述说明"></textarea>
                    <button onclick="addDiv('param')">+</button>
                    <button onclick="deleteDiv('param', 'param_0')">-</button>
                </div>
            </div>
            <div id="keyword_param" style="display:block;">
                <p id="title_keyword_param">关键字参数：</p>
                <div id="keyword_param_0">
                    <select name="keyword_param_type">
                        <option value="int" selected>int</option>
                        <option value="str">str</option>
                    </select>
                    <input name="keyword_param_name" type="text" size="20" placeholder="请填写参数名称">
                    <input name="keyword_param_default" type="text" size="10" placeholder="默认值"><br>
                    <textarea name="keyword_param_desc" rows="2" cols="60" placeholder="请填写描述说明"></textarea>
                    <button onclick="addDiv('keyword_param')">+</button>
                    <button onclick="deleteDiv('keyword_param', 'keyword_param_0')">-</button>
                </div>
            </div>
            <div id="input" style="display:block;">
                <p id="title_input">输入：</p>
                <div id="input_0">
                    <select name="input_type">
                        <option value="int" selected>int</option>
                        <option value="str">str</option>
                    </select>
                    <input name="input_name" type="text" size="20" placeholder="请填写名称"><br>
                    <textarea name="input_desc" rows="2" cols="60" placeholder="请填写描述说明"></textarea>
                    <button onclick="addDiv('input')">+</button>
                    <button onclick="deleteDiv('input', 'input_0')">-</button>
                </div>
            </div>
            <div id="output" style="display:block;">
                <p id="title_output">输出：</p>
                <div id="output_0">
                    <select name="output_type">
                        <option value="int" selected>int</option>
                        <option value="str">str</option>
                    </select>
                    <input name="output_name" type="text" size="20" placeholder="请填写名称（选填）"><br>
                    <textarea name="output_desc" rows="2" cols="60" placeholder="请填写描述说明"></textarea>
                    <button onclick="addDiv('output')">+</button>
                    <button onclick="deleteDiv('output', 'output_0')">-</button>
                </div>
            </div>
            <div id="return" style="display:none;">
                <p id="title_return">返回：</p>
                <div id="return_0">
                    <select name="return_type">
                        <option value="int" selected>int</option>
                        <option value="str">str</option>
                    </select><br>
                    <input name="return_name" type="text" size="20" placeholder="请填写返回参数名称（选填）"><br> 
                    <textarea name="return_desc" rows="2" cols="60" placeholder="请填写描述说明"></textarea>
                    <button onclick="addDiv('return')">+</button>
                    <button onclick="deleteDiv('return', 'return_0')">-</button> 
                </div>
            </div>
            <div id="exception">
                <p id="title_exception">异常：</p>
                <h3>提供常见报错类型可选，如需自定义异常类型，请在预览框中直接改写Error名称</h3>
                <div id="exception_0">
                    <select name="exception_type">
                        <option value="ValueError" selected>ValueError</option>
                        <option value="TypeError">TypeError</option>
                        <option value="RuntimeError">RuntimeError</option>
                        <option value="ImportError">ImportError</option>
                        <option value="AssertionError">AssertionError</option>
                        <option value="OSError">OSError</option>
                        <option value="NotImplementedError">NotImplementedError</option>
                    </select>
                    <input  name="exception_desc" type="text" size="50" placeholder="请填写异常描述">
                    <button onclick="addException('exception')">+</button>
                    <button onclick="deleteDiv('exception', 'exception_0')">-</button>
                </div>
            </div>
            <div id="supported_platform" style="display:none;">
                <p id="title_supported_platform">支持平台：</p>
                <form id="platform_checkbox" action="">
                    <input type="checkbox" name="checkbox" value="Ascend">Ascend<br>
                    <input type="checkbox" name="checkbox" value="GPU">GPU<br>
                    <input type="checkbox" name="checkbox" value="CPU">CPU<br>
                    <input type="checkbox" name="checkbox" value="Deprecated">Deprecated
                </form>
            </div>
            <div id="samples" style="display:none;">
                <p id="title_sample">样例代码：</p>
                <textarea id="code" rows="6" cols="60" placeholder="请填写样例代码（选填）">>>> </textarea><br>
                <textarea id="code_output" rows="3" cols="60" placeholder="请填写样例代码输出结果（选填）"></textarea>
            </div> -->
        </div>
        <body>
            <div id="right">
                <button id="preview" onclick="preview()">预览API文档</button>
                <button id="fix" onclick="fixDoc()">格式化API文档</button>
                <button id="download" onclick="downloadDoc()">下载API文档</button>
                <head>
                    <meta charset="UTF-8">
                    <meta name="viewport" content="width=device-width, initial-scale=1.0">
                    <title>Textarea 字体样式</title>
                    <style>
                        #desc2 {
                            width: 100%; /* 宽度填充整个容器 */
                            height: 300px; /* 设置一个初始高度 */
                            overflow-y: scroll; /* 当内容超出高度时显示垂直滚动条 */
                            resize: both; /* 允许用户调整大小 */
                            font-family: monospace; /* 等宽字体通常用于显示代码 */
                            white-space: pre-wrap; /* 保持格式 */
                            margin-top: 10px; /* 与按钮之间的间隔 */
                        }
                    </style>
                </head>
                <body>
                    <textarea id="desc2"></textarea>
                <body>
            </div>
        </body>
    </div>
</body>

</html>